<meta charset="utf-8">
<?php
include('link.php');
if(isset($_POST['submit']) && $_POST['submit']=='登陆'){
$email=$_POST['email'];
$name=$_POST['name'];
$pwd=$_POST['password'];
if($email==''||$name==''||$pwd==''){
    echo "请输入完整内容";
    }
    else{
        $sql="use study12";
        mysqli_query($conn,$sql);

        $sql1="select * from php1 where eamil ='$email'";
        $rs1=mysqli_query($conn,$sql1);

        $sql2="select * from php1 where name ='$name'";
        $rs2=mysqli_query($conn,$sql2);

        $sql3="select * from php1 where password ='$pwd'";
        $rs3=mysqli_query($conn,$sql3);

        if(mysqli_num_rows($rs1)==0){   
            echo "输入的邮箱不存在";
        }else if(mysqli_num_rows($rs2)==0||mysqli_num_rows($rs3)==0){
            echo "用户名错误或密码错误";
        }
        else {
            echo "登陆成功";
        }
     
    }
}
?>